<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Notice extends Model
{
    protected $fillable = ['title', 'content', 'type'];
    //
    const TYPE_SAFE = 0;

    const TYPE = [
        self::TYPE_SAFE,
    ];

    public function admins(){
        return $this->belongsToMany(Admin::class)->withPivot('status', 'read_at');
    }
    public function child(){
        return $this->belongsTo(Child::class);
    }
    public function childNotice(){
        return $this->hasOne(ChildNotices::class);
    }
}
